# 共享配置文件
import pytest
import requests
host = 'http://127.0.0.1:8888'
path = '/api/private/v1/login'
data_admin = [{
    'username': 'admin',
    'password': '123456'
}]


@pytest.fixture(params=data_admin)
def login(request):
    admin = request.param.get('username')
    passwd = request.param.get('password')
    url = host+path
    parm = {'username': 'admin', 'password': '123456'}
    response = requests.post(url, parm)
    token = response.json()['data']['token']
    return token




